﻿using DC2010.Objects.Base;
using DC2010.Objects;
using DC2010.Objects.Data;
using log4net;
using System.Reflection;


namespace DC2010.Effects
{
    public class EffectLogic : BaseObject
    {
        protected ILog log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);

        public EffectLogic(EffectData ed)
        {
            Info = Root.I.EffectSystem.GetInfo(ed.InfoId);
            Gfx = Root.I.EffectSystem.GetGfx(ed.GfxId);
            Data = ed;
        }

        public EffectInfo Info { get; set; }
        public EffectGfx Gfx { get; set; }
        public EffectData Data { get; set; }

        public EffectType EffectType { get; set; }

        public virtual void CalcSuccess(CreatureData aCaster, BaseObject aTarget) { }
        public virtual void Instant(BaseObject aInvoker, BaseObject aTarget) { }

        public virtual void Tick(BaseObject aTarget) { }
        public virtual bool CheckResisted(BaseObject aTarget) { return false; }

        public virtual bool CheckPumpCondition(BaseObject aTarget) 
        {
            return true;
        }


        public virtual void Pump(BaseObject aTarget) { }

        public void Init()
        { }

        public override string ToString()
        {
            return ShortName;
        }
    }
}
